import { Base } from '../../utils/base.js'

class Near extends Base {
  constructor() {
    super();
  }
  /*获得所有商家,pageIndex 从1开始*/
  getStores(pageIndex, callback) {
    var allParams = {
      url: 'store/all',
      data: {
        page: pageIndex
      },
      type: 'get',
      sCallback: function(data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }
  //距离
  getDistance(lat1, lng1, lat2, lng2, callback) {
    var Params = {
      url: 'store/dis/' + lat1 + '/' + lng1 + '/' + lat2 + '/' + lng2,
      sCallback: function(data) {
        callback && callback(data);
      }
    };
    this.request(Params);
  }
}

export {
  Near
};